
import os,sys
import wx
import wx.html

class exHtmlWindow(wx.html.HtmlWindow):
   def __init__(self, parent, id, frame):
      wx.html.HtmlWindow.__init__(self,parent,id)

class exHtmlPanel(wx.Panel):
   def __init__(self, parent, id, frame):
      wx.Panel.__init__(self,parent,-1)

      self.html = exHtmlWindow(self, -1, frame)
      self.html.SetPage("<html><h1>Hello</h1></html>")

      self.box = wx.BoxSizer(wx.VERTICAL)
      self.box.Add(self.html, 1, wx.GROW)

      self.SetSizer(self.box)
      self.SetAutoLayout(True)

class exFrame (wx.Frame):
   def __init__(self, parent, ID, title):
      wx.Frame.__init__(self,parent,ID,title,wx.DefaultPosition,
                        wx.Size(600,750))
      self.panel = exHtmlPanel(self, -1, self)

class exApp(wx.App):
    def __init__(self, htmltext):
        self.htmltext = htmltext
        wx.App.__init__(self, 0)
    def OnInit(self):
        frame = exFrame(None, -1, "Example Browser")
        frame.panel.html.SetPage(self.htmltext)
        frame.Show(True)
        self.SetTopWindow(frame)
        return True


class entry(object):
    
    def incoming(self, event):
        htmltext, = event.data
        app = exApp(htmltext)
        app.MainLoop()
    